home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / Sun1_2Signing.java < prev    next >
Text File  |  1998-10-14  |  2KB  |  73 lines

  1. package com.symantec.itools.tools.archive;
  2.  
  3.  
  4. import java.io.File;
  5. import java.io.IOException;
  6. import com.symantec.itools.io.FileSystem;
  7. import com.symantec.itools.lang.Debug;
  8. import com.symantec.itools.lang.ProcessManager;
  9.  
  10.  
  11. /**
  12.  * @author Symantec Internet Tools Division
  13.  * @version 1.0
  14.  * @since VCafe 3.0
  15.  */
  16.  
  17. public class Sun1_2Signing
  18.     extends SunSigning
  19. {
  20.  
  21.     /**
  22.      * @since VCafe 3.0
  23.      */
  24.     protected ProcessManager processManager;
  25.  
  26.     public Sun1_2Signing(Options options)
  27.     {
  28.         super(options);
  29.     }
  30.  
  31.     /**
  32.      * @param errorMsg TODO
  33.      * @since VCafe 3.0
  34.      */
  35.  
  36.     public boolean sign(StringBuffer errorMsg)
  37.     {
  38.         StringBuffer command;
  39.  
  40.         command = new StringBuffer(FileSystem.quoteIfNeeded(FileSystem.getCanonicalPath(options.getSunTools(), true) + "javakey.exe"));
  41.         command.append(FileSystem.quoteIfNeeded(options.getOutputLocation()));
  42.  
  43.         try
  44.         {
  45.             processManager = new ProcessManager();
  46.  
  47.             if(processManager.monitorLaunchedProcess(Runtime.getRuntime().exec(command.toString())) != 0)
  48.             {
  49.                 return (false);
  50.             }
  51.         }
  52.         catch(IOException ex)
  53.         {
  54.             Debug.logException(ex);
  55.             return (false);
  56.         }
  57.  
  58.         return (true);
  59.     }
  60.  
  61.     /**
  62.      * @since VCafe 3.0
  63.      */
  64.  
  65.     public void cancel()
  66.     {
  67.         if(processManager != null)
  68.         {
  69.             processManager.destroyProcess();
  70.             processManager = null;
  71.         }
  72.     }
  73. }